#pragma strict

var speed:float;
var hurt:float=2f;
private var myTransform:Transform;
var explotionPrefab:GameObject;
function Start () {
	myTransform=this.transform; 
}

function Update () {
	myTransform.Translate(Vector3.down*Time.deltaTime*speed);
	if(myTransform.position.y<=-4)
	{
		Destroy(this.gameObject);
	}
}



//发生碰撞后爆炸
function OnTriggerEnter (other:Collider ) {
	if(other.GetComponent(jsPlayer))
	{
		doparticleSystem();
		Destroy(this.gameObject);
	}
}

function doparticleSystem()
{
	Instantiate(explotionPrefab,this.transform.position,this.transform.rotation);
}